package cn.wnco.ctrl;

import cn.wnco.anno.IAuth;
import cn.wnco.anno.IRole;
import cn.wnco.tool.Tmap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("common")
public class CommonCtrl {


    @GetMapping("a")
    @IAuth("getA")
    @IRole
    public Map<String, Object> getA(String name) {
        Map<String, Object> uid = Tmap.instance().getContext().getCuser();
        uid.put("uname", name);
        return uid;
    }


}
